<div class="mainBody-box-bg1">
<a href="?reset=1">重置计数器</a>
</div>

<div class="list-div" id="listDiv">
<table cellspacing='1' cellpadding='1' id='list-table' bgcolor="#cccccc" width="100%" class="table1">
	<tr>
		<th height="40">模块</th>
		<th>生成记录数</th>
		<th>操作</th>
	</tr>
	<tr>
		<td height="40">社区模块</td>
		<td><span id="span_num_community">0</span></td>
		<td><a href="javascript:g_test('community')">生成记录</a></td>
	</tr>
	<tr>
		<td height="40">业主模块</td>
		<td><span id="span_num_owner">0</span></td>
		<td><a href="javascript:g_test('owner')">生成记录</a></td>
	</tr>
	<tr>
		<td height="40">商家模块</td>
		<td><span id="span_num_shop">0</span></td>
		<td><a href="javascript:g_test('shop')">生成记录</a></td>
	</tr>
	<!-- <tr>
		<td height="40">业主商家模块</td>
		<td><span id="span_num_ownershop">0</span></td>
		<td><a href="javascript:g_test('ownershop')">生成记录</a></td>
	</tr> -->
	<tr>
		<td height="40">积分交易增加</td>
		<td><span id="span_num_integralChange">0</span></td>
		<td><a href="javascript:g_test('integralChange',300000)">生成记录</a></td>
	</tr>
	<tr>
		<td height="40">商户供应商</td>
		<td><span id="span_num_supplier">0</span></td>
		<td><a href="javascript:g_test('supplier',200000)">生成记录</a></td>
	</tr>
	<tr>
		<td height="40">积分交易扣减</td>
		<td><span id="span_num_integralChangeReduce">0</span></td>
		<td><a href="javascript:g_test('integralChangeReduce',400000)">生成记录</a></td>
	</tr>
</table>
</div>
{literal}
<script>
function g_test(t)
{
	var c = 100000;
	if(arguments.length==2)
	{
		c = arguments[1];
	}
	$.ajax({
	    type: "POST",
		data:{"t":t,"isAjax":1},
	    url: "/admin/index/test?t"+Math.random(),
	    success: function(data) {
			if(data == -1000){
				window.location.href="/admin/";
				return;
			}
			else if(data == -1)
			{
				alert(data);
				return;
			}
			

			$("#span_num_"+t).html(data);

			if(Number(data)<c)
			{
				g_test(t,c);
			}
	    },
		error:function(){
		}
	});
}
</script>
{/literal}
